<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <title>打印</title>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/print.css" media="print">
    <style>
        .print{
            width: 300px;
            margin: 0 auto;
        }
        .print td{
            border: 1px #eee solid;
        }
        button{
            display: block;
            margin: 100px auto 0;
        }
    </style>
</head>
<body>
    <div class="print" id="print">
        <table>
            <thead>
                <tr>
                    <th colspan="3">标题</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>data</td>
                    <td>data</td>
                    <td>data</td>
                </tr>
                <tr>
                    <td>data</td>
                    <td>data</td>
                    <td>data</td>
                </tr>
                <tr>
                    <td>data</td>
                    <td>data</td>
                    <td>data</td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <th colspan="3"><img src="https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D600%2C800/sign=fa912e9c8726cffc697fb7b4893166a8/7e3e6709c93d70cf7613f208fddcd100bba12bcd.jpg" width="300"></th>
                </tr>
            </tfoot>
        </table>
    </div>
    <button type="button" id="print-btn">打印</button>
    <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script src="js/jquery.jqprint.js"></script>
    <script type="text/javascript">
        $('#print-btn').click(function(){
            if($("#print").length){
                $("#print").jqprint();
                return
            }
        });
        $(document).bind('keydown', function(e) {
            var code = (e.keyCode ? e.keyCode : e.which);
            if(code == 13 && $("#print").length){
                $("#print").jqprint();
                return
            }
        });
    </script>
</body>
</html>